
package com.mengmeizi;

import com.android.update.ADViewFliperLayout;

import android.app.Activity;
import android.app.Application;

import java.util.ArrayList;

public class SoftApplication extends Application {

    private ArrayList<Activity> activitieLists;

    private ADViewFliperLayout adLayout;

    @Override
    public void onCreate() {
        super.onCreate();
        activitieLists = new ArrayList<Activity>();
    }

    public void addActivity(Activity activity) {
        activitieLists.add(activity);
    }

    public void exit() {
        for (int i = 0; i < activitieLists.size(); i++) {
            Activity activity = activitieLists.get(i);
            if (activity != null) {
                activitieLists.get(i).finish();
            }
        }
    }

    public void storeAdLayout(ADViewFliperLayout adLayout) {
        this.adLayout = adLayout;
    }

    public ADViewFliperLayout getAdLayout() {
        return adLayout;
    }

}
